﻿<%@ Page Language="C#" MasterPageFile="~/Layouts/Form.Master" AutoEventWireup="true" CodeBehind="RoleEdit.aspx.cs" Inherits="Bingosoft.WebApp.Modules.SecurityConsole.Role.RoleEdit" %>
<%@ Import Namespace="Bingosoft.Security" %>

<asp:Content ContentPlaceHolderID="head" ID="idFormTitle" runat="server">
    <title>
        <%=Request["title"]%></title>
</asp:Content>
<asp:Content ContentPlaceHolderID="Content" ID="idFormMain" runat="server">
    <!-- 页面头部 -->
    <div class="header">
        <h1>
            <%=Request["title"]%></h1>
    </div>
    <web:SmartFormView ID="SmartFormView1" runat="server" DataKeyNames="Id" DataSourceID="SmartDataSource1" Width="100%" >
        <InsertItemTemplate>
        </InsertItemTemplate>
        <EditItemTemplate>
        </EditItemTemplate>
        <ItemTemplate>
            <div>
                <table cellpadding='2' cellspacing='1' width='100%' class="formitem">
                    <caption>
                        <%=Request["title"]%></caption>
                    <tr>
                        <th>
                            角色名称:<font color='red'>*<font>
                        </th>
                        <td>
                            <asp:TextBox ID='Name' runat='server' Text='<%#Bind("Name")%>' Width='260px' validator="required,length[1,50]"></asp:TextBox>
                            <asp:HiddenField ID="Id" Value='<%#Bind("Id")%>' runat='server' />
                        </td>
                    </tr>
                    <% if (SecurityContext.HasPermission("ROLE_MANAGE$EDIT_WORKFLOW_ROLE"))
                       {%>
                    <tr>
                        <th>
                            角色类型:<font color="red">*<font>
                        </th>
                        <td>
                            <asp:DropDownList runat="server" ID="Type" SelectedValue='<%# Bind("Type") %>'   OnDataBound="ddlType_SelectedIndexChanged" OnSelectedIndexChanged="ddlType_SelectedIndexChanged" AutoPostBack="true"  Width='267px' validator="required" >
                                <asp:ListItem Text=""></asp:ListItem>
                                <asp:ListItem Value="0" Text="管理类"></asp:ListItem>
                                <asp:ListItem Value="1" Text="流转类"></asp:ListItem>
                                <asp:ListItem Value="2" Text="混合类"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr> 
                    <tr>
                        <th>
                          <asp:Literal runat="server" ID="ltlParticipantType">参与者角色:</asp:Literal>  
                        </th>
                        <td>
                            <asp:DropDownList runat="server" ID="ParticipantType" SelectedValue='<%# Bind("ParticipantType") %>' Enabled="false"  Width='267px' validator="required" >
                                <asp:ListItem Text=""></asp:ListItem>
                                <asp:ListItem Value="0" Text="用户"></asp:ListItem>
                                <asp:ListItem Value="1" Text="部门"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr> 
                    <%
                       }%>
                    <tr>
                        <th>
                            角色描述:
                        </th>
                        <td>
                            <asp:TextBox TextMode="MultiLine" Rows="5" Columns="40" ID="Description" runat="server"
                                Text='<%#Bind("Description")%>' Width='260px' Validator="length[0,1000]"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </div>
        </ItemTemplate>
    </web:SmartFormView>
    <web:SmartSqlDataSource ID="SmartDataSource1" runat="server" SelectCommand="role.get.role.by.Id"
        SelectCommandAutoPageWrap="false">
    </web:SmartSqlDataSource>
    <!-- 页脚区域 -->
    <div class="footer">
        <asp:Button ID="Button1" runat="server" Text="确定" OnClientClick="return validateForm();" OnClick="SaveOrUpdate" />
        <asp:Button ID="CloseButton2" runat="server" Text="关闭" OnClientClick="return closeForm();" />
    </div>
</asp:Content>
